package com.hfi.mapper;

import com.hfi.model.Employee;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author ChangLiang
 * @date 2019/5/15
 */
@Repository
public interface EmployeeMapper {
    Employee getEmployeeById(Integer id);

    Long addEmp(Employee employee);

    boolean updateEmp(Employee employee);

    void deleteEmpById(Integer id);

    Employee getEmpByIdAndLastName(@Param("id") Integer id, @Param("lastName") String lastName);

    Employee getEmpByMap(Map<String, Object> map);

    List<Employee> getEmpsByLastNameLike(String lastName);

    Map<String, Object> getEmpByIdReturnMap(Integer id);

    @MapKey("lastName")
    Map<String, Employee> getEmpByLastNameLikeReturnMap(String lastName);
}
